/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Homework2;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BoxLayout;

/**
 *
 * @author Jakim
 */
public class ButtonsForm extends Frame{
    public Button btn11;
    public Button btn12;
    public Button btn13;
    public Button btn21;
    public Button btn22;
    public Button btn23;
    public Button btn24;
    public Button btn31;
    public Button btn32;
    public Button btn33;
    
    public Panel panel1;
    public Panel panel2;
    public Panel panel3;
    public Panel panel4;
    
    public ButtonsForm(){
        super();
        this.setSize(300, 300);
        this.setLayout(new BorderLayout());

        this.btn11 = new Button("Button11");
        this.btn12 = new Button("Button12");
        this.btn13 = new Button("Button13");
        this.btn21 = new Button("Button21");
        this.btn22 = new Button("Button22");
        this.btn23 = new Button("Button23");
        this.btn24 = new Button("Button24");
        this.btn31 = new Button("Button31");
        this.btn32 = new Button("Button32");
        this.btn33 = new Button("Button33");

        this.panel1 = new Panel();
        this.panel1.setLayout(new BoxLayout(this.panel1, BoxLayout.PAGE_AXIS));
        this.panel1.add(btn11);
        this.panel1.add(btn12);
        this.panel1.add(btn13);

        this.panel2 = new Panel(new GridLayout(2, 2));
        this.panel2.add(btn21);
        this.panel2.add(btn22);
        this.panel2.add(btn23);
        this.panel2.add(btn24);

        this.panel4 = new Panel();       
        this.panel4.setLayout(new FlowLayout());
        this.panel4.add(this.panel1);
        this.panel4.add(this.panel2);

        this.panel3 = new Panel(new FlowLayout(FlowLayout.LEADING, 20, 20));
        this.panel3.add(btn31);
        this.panel3.add(btn32);
        this.panel3.add(btn33);

        this.add(this.panel1, BorderLayout.WEST);
        this.add(this.panel2, BorderLayout.CENTER);
        this.add(this.panel3, BorderLayout.SOUTH);
        this.setVisible(true);
        this.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    }

    public static void main(String args[]){
        new ButtonsForm();
    }
}
